//
//  MBDRejectReasonCell.swift
//  MasterBoy
//
//  Created by kyson on 2024/4/9.
//

import Foundation

import YYText
import SnapKit

class MBDRejectReasonCell : MBDCommonCell {
    
    var titleLabel : YYLabel!
    
    
    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        self.initialize()
    }
    
    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
        
        self.initialize()
    }
    
    
    func initialize() {
        self.contentView.backgroundColor = UIColor.red
        self.commonBackgroundView.backgroundColor = UIColor.red
        
        titleLabel = YYLabel()
        self.contentView.addSubview(titleLabel)

        titleLabel.snp.makeConstraints { make in
            make.centerY.equalTo(self.contentView)
            make.left.equalTo(20)
            make.right.equalTo(rightArrowImage.snp.left).offset(-10)
            make.height.equalTo(18)
        }
        
    }
    
    override var cellModel: Any! {
        didSet {
            self.separateLine.isHidden = true
            self.rightArrowImage.isHidden = true
            
            let realCellModel = self.cellModel as! MBDRejectReasonCellModel
            titleLabel.textLayout = realCellModel.reasonLayout
        }
    }
}
